#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <ctype.h>
int main()
{
	char arr[30] = { 0 };
	scanf("%[^\n]s", arr);
	int i = 0;
	while (arr[i])
	{
		if (islower(arr[i]))
		{
			arr[i] = toupper(arr[i]);
		}
		else if (isupper(arr[i]))
		{
			arr[i] = tolower(arr[i]);
		}
		i++;
	}
	printf("%s", arr);
	return 0;
}